home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / pas_all.zip / TI342.ASC < prev    next >
Text File  |  1992-08-12  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.   PRODUCT : TURBO PASCAL                               NUMBER : 342
  10.   VERSION : 3.02A
  11.        OS : PC-DOS, MS-DOS
  12.      DATE : October 9, 1986                              PAGE : 1/2
  13.     TITLE : ADVANCED FILE HANDLING
  14.  
  15.  
  16.  
  17.  
  18.   The following information  is  presented  for  advanced  users of
  19.   Turbo Pascal using MS-DOS or PC-DOS operating systems.
  20.  
  21.   Turbo Pascal uses MS-DOS file  handles  to  open  files. Function
  22.   call 3DH is used. One of the parameters to this call is the "open
  23.   mode,"  which provides DOS with information  about  the  way  you
  24.   intend to access the file and what access to allow other process
  25.  
  26.   Turbo  Pascal  normally  uses  an  open  mode  byte of  2,  which
  27.   designates   Compatibility   Mode   with  Read/Write  Access  and
  28.   Inheritance by child processes. By  changing  the  value  of this
  29.   byte to  0,  you  may  open  Read-only  files. There may be other
  30.   applications for
  31.  
  32.   Open mode byte for Reset & Rewrite (PC-DOS):
  33.  
  34.       TURBO.COM    CSEG:$24C6
  35.       TURBO-87.COM CSEG:$1F75
  36.       TURBOBCD.COM CSEG:$23CE
  37.  
  38.   Open mode byte for Reset & Rewrite (MS-DOS):
  39.  
  40.       TURBO.COM    CSEG:$21EE
  41.       TURBO-87.COM CSEG:$1C9D
  42.       TURBOBCD.COM CSEG:$20F6
  43.  
  44.   The best way  to  use  this  information is to create an absolute
  45.   variable pointing to the byte, for example:
  46.  
  47.    var OpenModeByte: byte absolute CSeg:$24C6; (TURBO.COM PC-DOS)
  48.  
  49.   For additional safety, make sure that the value of the byte being
  50.   changed is actually 2 before  changing  it.  Remember,  change it
  51.   back to 2 if you intend to do normal file opening intermixed with
  52.   opening of Read-only or shared files. Information on the diff
  53.  
  54.   { Using TURBO.COM version 3.02A }
  55.  
  56.   var OpenModeByte: byte absolute CSeg:$24C6;  (TURBO.COM PC-DOS)
  57.  
  58.   Procedure AccessReadOnly;
  59.  
  60.   begin
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.   PRODUCT : TURBO PASCAL                               NUMBER : 342
  76.   VERSION : 3.02A
  77.        OS : PC-DOS, MS-DOS
  78.      DATE : October 9, 1986                              PAGE : 2/2
  79.     TITLE : ADVANCED FILE HANDLING
  80.  
  81.  
  82.  
  83.  
  84.     if not(OpenModeByte in [0, 2]) then
  85.       Error
  86.     else
  87.       OpenModeByte := 0;
  88.   end;
  89.  
  90.   procedure AccessReadWrite;
  91.  
  92.   begin
  93.     if not(OpenModeByte in [0, 2]) then
  94.       Error
  95.     else
  96.       OpenModeByte := 2;
  97.   end;
  98.  
  99.   The  open  mode  byte  for  overlay, chain, and execute files  is
  100.   normally 0, Compatibility Mode with  Read  Access.  The addresses
  101.   for  these  mode  bytes  can  be found by searching the  run-time
  102.   library for the bytes 00 3D. The first occurrence is the one used
  103.   for ov
  104.  
  105.   DISCLAIMER: You  have the right to use this technical information
  106.   subject to the terms  of  the  No-Nonsense License Statement that
  107.   you received with  the  Borland product to which this information
  108.   pertains.
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.